#pragma once

#include <cmath>
#include <memory>
#include "rtda/frame.h"
#include "native/registry.h"

namespace jvm {
    namespace lang {

        class DoubleNative {
        private:
            static const std::string JL_DOUBLE;

        public:
            static void init() {
                native::Registry::registerMethod(JL_DOUBLE, "doubleToRawLongBits",
                    "(D)J", &doubleToRawLongBits);
                native::Registry::registerMethod(JL_DOUBLE, "longBitsToDouble",
                    "(J)D", &longBitsToDouble);
            }

            static void doubleToRawLongBits(std::shared_ptr<rtda::Frame> frame);
            static void longBitsToDouble(std::shared_ptr<rtda::Frame> frame);
        };

    } // namespace lang
} // namespace jvm